<template>
    <div class="card">
        <div class="card-title" :class="border ? 'border': ''">
            <div class="title">{{title}}</div>
            <div class="desc" v-if="desc">{{desc}}</div>
        </div>
        <div class="card-main" :style="{padding}">
            <slot></slot>
        </div>
    </div>
</template>

<script>
    export default {
        name: "card",
        props: {
            title: {
                type: String,
                default: ''
            },
            desc: {
                type: String,
                default: ''
            },
            border: {
                type: Boolean,
                default: true
            },
            padding: {
                type: String,
                default: '24px'
            }
        }
    }
</script>

<style lang="less" scoped>
    .card {
        width: 900px;
        background: rgba(255, 255, 255, 1);
        border-radius: 4px;
        margin-bottom: 16px;
        z-index: 99;
        .card-title {
            .flexed(start);
            height: 48px;
            font-size: 16px;
            font-weight: 500;
            color: rgba(0, 0, 0, 1);
            line-height: 48px;
            padding-left: 24px;
            
            .title {
                margin-right: 24px;
            }
            
            .desc {
                font-size: 14px;
                font-weight: 400;
                color: rgba(0, 0, 0, .4);
                line-height: 48px;
            }
        }
        .border {
            border-bottom: 2px solid rgba(0, 0, 0, .04);
        }
        
        .card-main{
        }
    }
</style>
